import { myEnv } from '@/myEnv';
import { mergeRequest } from '@/utils';
type Rsponse = {
    code: string;
    message: string;
}

/** 修改收藏状态 */
export const apiPutSetRead = async (id: string) => {
    const response: Rsponse = await sendRequest(id);
    return response;
};

const sendRequest = async (id: string) => {
    let response1: Rsponse;
    if (myEnv.IS_ON_LINE) {
        response1 = await mergeRequest({
            url: `/user/message/${id}`,
            method: 'PUT',
        });
    } else {
        response1 = {
            code: '200',
            message: 'ok',
        };
    }
    return response1;
};
